/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "scientificname")
@NamedQueries({
    @NamedQuery(name = "Scientificname.findAll", query = "SELECT s FROM Scientificname s"),
    @NamedQuery(name = "Scientificname.findByIdscientificname", query = "SELECT s FROM Scientificname s WHERE s.idscientificname = :idscientificname"),
    @NamedQuery(name = "Scientificname.findByScientificname", query = "SELECT s FROM Scientificname s WHERE s.scientificname = :scientificname")})
public class Scientificname implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idscientificname")
    private Integer idscientificname;
    @Basic(optional = false)
    @Column(name = "scientificname")
    private String scientificname;
    @OneToMany(mappedBy = "scientificname", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Scientificname() {
    }

    public Scientificname(Integer idscientificname) {
        this.idscientificname = idscientificname;
    }

    public Scientificname(Integer idscientificname, String scientificname) {
        this.idscientificname = idscientificname;
        this.scientificname = scientificname;
    }

    public Integer getIdscientificname() {
        return idscientificname;
    }

    public void setIdscientificname(Integer idscientificname) {
        this.idscientificname = idscientificname;
    }

    public String getScientificname() {
        return scientificname;
    }

    public void setScientificname(String scientificname) {
        this.scientificname = scientificname;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idscientificname != null ? idscientificname.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scientificname)) {
            return false;
        }
        Scientificname other = (Scientificname) object;
        if ((this.idscientificname == null && other.idscientificname != null) || (this.idscientificname != null && !this.idscientificname.equals(other.idscientificname))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Scientificname[idscientificname=" + idscientificname + "]";
    }

}
